package cn.linpq.util;
import javax.swing.*;
import java.awt.*;

/**
 * Desc : 工具类
 * ClassName : cn.linpq.util.Tools
 * @author : 林鹏群
 * @date : 2022/12/12 11:39
 */
public class Tools {
    public static int rows = 9;
    public static int cols = 9;
    public static int totalMines = 80;
    public static ImageIcon blank = new ImageIcon("./picture/blank.gif");
    public static ImageIcon hole = new ImageIcon("./picture/hole.gif");
    public static ImageIcon mine = new ImageIcon("./picture/mine.gif");
    public static ImageIcon redMine = new ImageIcon("./picture/blood.gif");
    public static ImageIcon flag = new ImageIcon("./picture/flag.gif");
    public static ImageIcon ask = new ImageIcon("./picture/ask.gif");
    public static ImageIcon ask1 = new ImageIcon("./picture/ask1.gif");
    public static ImageIcon[] mineCount = new ImageIcon[9];
    public static ImageIcon[] faces = new ImageIcon[10];
    public static ImageIcon[] count = new ImageIcon[10];
    public static Image logo =  new ImageIcon("./picture/icon.gif").getImage();
    public static int delay = 500;

    static {
        for (int i = 0; i < mineCount.length ; i++) {
            mineCount[i] =  new ImageIcon("./picture/"+i+".gif");
        }
        for (int i = 0; i < faces.length ; i++) {
            faces[i] =  new ImageIcon("./picture/face"+i+".gif");
        }
        for (int i = 0; i < count.length ; i++) {
            count[i] =  new ImageIcon("./picture/d"+i+".gif");
        }
    }

    public static void elementary() {
        Tools.rows = 9;
        Tools.cols = 9;
        Tools.totalMines = 10;
    }

    public static void intermediate() {
        Tools.rows = 20;
        Tools.cols = 20;
        Tools.totalMines = 30;
    }

    public static void advanced() {
        Tools.rows = 40;
        Tools.cols = 50;
        Tools.totalMines = 500;
    }

    public static void harder() {
        Tools.totalMines +=1;
    }
}
